#ifndef _TRANSLATOR_H_
#define _TRANSLATOR_H_

#include <iostream>
#include <vector>
#include "parser.h"

using namespace std;

class Translator{
public:
	const vector<Instr> & is;
	vector<string> statements; //translated statements within the function

	Translator(vector<Instr>& instrs): is(instrs), statements(){}

	void translate();

	void output(ostream& o);

	bool translateFunction(int& entry, int& end);

	void translateStatement(int idx, bool isMain, int nVar, int nParam);

	void translateParam(Param& p, string& cr);
};


#endif
